

var cfg ={
  show_load(){
    wx.showLoading({
      title: '加载中',
    })
  },
  hide_load(){
    wx.hideLoading()
  },
    toast(msg){
        wx.showToast({
            title: msg,
            icon:'none'
          })
    },
    confirm(msg){
    //   return  Dialog.confirm({
    //         title: '请确认',
    //         message: msg,
    //       })
            return new Promise((resolve,reject)=>{
                wx.showModal({
                    title: '确认',
                    content: msg,
                    success (res) {
                    if (res.confirm) {
                        resolve()
                    } else if (res.cancel) {
                        reject()
                    }
                    }
                })

            })
        
          
    },
    showMsg(msg){

        return new Promise((resolve,reject)=>{
            wx.showModal({
                title: '提示',
                content: msg,
                showCancel:false,
                success (res) {
                  if (res.confirm) {
                    resolve()
                  } else if (res.cancel) {
                    reject()
                  }
                }
              })
    
        })

        
    }
}

export default cfg

// module.exports = {
//     default:cfg,
//     cfg
// }